<?php
/**
 * Created by a front-end programmer.
 * User: Xwen
 * Date: 2018/2/26
 * Time: 10:19
 * Mail:lauwencn@gmail.com
 */
class CategoryModel extends Model{
    public $table = 'category';
    public function __construct($table = NULL)
    {
        $table = $this->table;
        parent::__construct($table);
    }

    public function add_data(){
        return $this->add();
    }
    public function get_all(){
        return $this->all();
    }
    public function get_one($cid){
        return $this->where('cid='.$cid)->find();
    }
    public function remove($cid){
        $this->where('cid='.$cid)->delete();
    }
    public function edit($cid){
        $this->where('cid='.$cid)->update();
    }
}